package vns.server.domain;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Link;
import vns.shared.ObjectTypeLinkDTO;

public class ObjectTypeLink {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;
	
	@Persistent
	private Link value;
	
	public ObjectTypeLink(ObjectTypeLinkDTO objectTypeLinkDTO){
		this.value=objectTypeLinkDTO.getValue();
	}
	
	public void updatefromDTO(ObjectTypeLinkDTO objectTypeLinkDTO){
		this.value=objectTypeLinkDTO.getValue();
	}
	
	public ObjectTypeLinkDTO toDTO(){
		ObjectTypeLinkDTO otLink=new ObjectTypeLinkDTO(this.id,this.value);
		return otLink;
	}
	
	public Key getId(){
		return id;
	}
	
	public Link getValue(){
		return value;
	}
	
	public void setValue(Link Value){
		this.value=Value;
	}
}
